package com.x.erp.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.CarCheckDao;
import com.x.erp.model.CarCheckVO;
import com.x.erp.rpc.CarCheckRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Service(interfaceName = "com.x.erp.rpc.CarCheckRpcService", timeout = 60000)
public class CarCheckService extends BaseService implements CarCheckRpcService {

	@Autowired
	private CarCheckDao carCheckDao;//车辆审核DAO

	/**
	 * 查询车辆审核列表gi
	 * @param carCheckVO
	 * @return
	 */
	@Override
	public List<CarCheckVO> selectCarCheckList(CarCheckVO carCheckVO) {
		try {
			return carCheckDao.selectCarCheckList(carCheckVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	/**
	 * 查询车辆审核总数
	 * @param carCheckVO
	 * @return
	 */
	@Override
	public Integer selectCarCheckNum(CarCheckVO carCheckVO) {
		try {
			return carCheckDao.selectCarCheckNum(carCheckVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

}
